<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 复制下方内容到火山登录页F12下执行
        const dahao = ["a452746100",
            "b452746100",
            "c452746100",
            "d452746100",
            "e452746100",
            "f452746100",
            "g452746100",
            "h452746100",
            "i452746100",
            "j452746100",
            "k452746100",
            "l452746100",
            "m452746100",
            "n452746100",
            "o452746100",
            "p452746100",
            "q452746100",
            "r452746100",
            "s452746100",
            "t452746100",
            "u452746100",
            "v452746100",
            "w452746100",
            "x452746100",
            "y452746100",
            "z452746100"]
        const xiaohao = [];
        const cangku = [];
        const maxLeng = 630; // 当前号码注册最大值
        for (let index = 1; index <= maxLeng; index++) {
            let use = 'gxst';
            if (index < 11) {
                use += '00' + index;
            } else if (index == 100) {
                use += index;
            } else if (index < 101) {
                use += '0' + index;
            } else {
                use += index;
            }
            if (index < 101) {
                xiaohao.push(use);
            } else {
                cangku.push(use);
            }
        }
        const all = [...dahao, ...xiaohao, ...cangku];
        const dahaoToken = [];
        const xiaohaoToken = [];
        const cangkuToken = [];
        let index = 0;
        let timer = 0;
        timer = setInterval(async () => {
            if (index >= all.length) {
                clearInterval(timer);
                localStorage.setItem("dahaoToken", dahaoToken.join(','))
                localStorage.setItem("xiaohaoToken", xiaohaoToken.join(','))
                localStorage.setItem("cangkuToken", cangkuToken.join(','))
                return;
            }
            const sid = await getToken(index);
            if (index < 26) {
                dahaoToken.push(sid);
            } else if (index < 126) {
                xiaohaoToken.push(sid);
            } else {
                cangkuToken.push(sid);
            }
            console.log('dahaoToken', dahaoToken.join(','));
            console.log('xiaohaoToken', xiaohaoToken.join(','));
            console.log('cangkuToken', cangkuToken.join(','));
            index++;
        }, 1200)
        const getToken = (index) => {
            return new Promise((resolve, reject) => {
                let xhr = new XMLHttpRequest(); // 创建XHR对象
                xhr.onreadystatechange = function () {
                    if (xhr.readyState == 4) { // 4表示此次请求结束
                        const sidIndex = this.responseText.indexOf("sid=");
                        resolve(this.responseText.substring(sidIndex, sidIndex + 32));
                    }
                };
                xhr.open( // 打开链接
                    "post",
                    "http://www.5iwapgame.com/home/loginValidate.go", // 后端地址
                    true
                );
                xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); // 设置请求头
                xhr.send( // 设置需要携带到后端的字段，字符串形式
                    "account=" + all[index] +
                    "&password=" + "dg110929" // 注意：字段之间需要加上 “ & ” 字符
                );
            })
        }
    </script>
</body>

</html>